package br.com.infocruz.seam.crm.ejb.exception;

import java.util.concurrent.Future;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.async.AsynchronousExceptionHandler;
import org.jboss.seam.log.Log;

@Scope(ScopeType.STATELESS)
@Name("org.jboss.seam.async.asynchronousExceptionHandler")
public class CustomAsynchronousExceptionHandler extends AsynchronousExceptionHandler {

	@Logger
	Log log;

	@In
	Future timer;

	@Override
	public void handleException(Exception exception) {

		log.debug(exception);

		timer.cancel(false);

	}

}